home *** CD-ROM | disk | FTP | other *** search
- /* WIDE AREA INFORMATION SERVER SOFTWARE:
- No guarentees or restrictions. See the readme file for the full standard
- disclaimer.
-
- 5.29.90 Harry Morris, morris@think.com
- */
-
- /* Copyright (c) CNIDR (see ../COPYRIGHT) */
-
-
- /* there are three kinds of C that we have encountered so far:
-
- 1. ANSI_LIKE - full prototypes and stdargs and ansi includes
- 2. PROTO_ANSI - full prototypes, varargs and misc includes
- 3. K_AND_R - k&r prototypes, varargs and misc includes
-
- This file is a mess because some compilers do not handle elif. sorry.
-
- defined symbols for other machines:
- hp: hpux
- Next: NeXT
- */
-
- #ifndef C_DIALECT
- #define C_DIALECT
-
- /*----------------------------------------------------------------------*/
-
- #include "../config.h"
- #ifndef USTUBS_H
- #include <stdlib.h>
- #endif /* USTUBS_H */
- /* AIX requires this to be the first thing in the file. */
- #ifdef __GNUC__
- #define alloca __builtin_alloca
- #else /* not __GNUC__ */
- #if HAVE_ALLOCA_H
- #include <alloca.h>
- #else /* not HAVE_ALLOCA_H */
- #ifdef _AIX
- #pragma alloca
- #else /* not _AIX */
- char *alloca ();
- #endif /* not _AIX */
- #endif /* not HAVE_ALLOCA_H */
- #endif /* not __GNUC__ */
-
- #ifdef TIME_WITH_SYS_TIME
- /* #ifdef TM_IN_SYS_TIME */
- #include <sys/time.h>
- #include <time.h>
- #else
- #ifdef HAVE_SYS_TIME_H
- #include <sys/time.h>
- #else
- #include <time.h>
- #endif
- #endif
-
- #include <sys/types.h> /* does this line any harm? (up) */
-
- #ifdef HAVE_UNISTD_H
- #include <unistd.h>
- #endif
-
-
- /* unistd.h defines _POSIX_VERSION on POSIX.1 systems. */
- #if defined(DIRENT) || defined(_POSIX_VERSION)
- #include <dirent.h>
- #define NLENGTH(dirent) (strlen((dirent)->d_name))
- #else /* not (DIRENT or _POSIX_VERSION) */
- #define dirent direct
- #define NLENGTH(dirent) ((dirent)->d_namlen)
- #ifdef SYSNDIR
- #include <sys/ndir.h>
- #endif /* SYSNDIR */
- #ifdef SYSDIR
- #include <sys/dir.h>
- #endif /* SYSDIR */
- #ifdef NDIR
- #include <ndir.h>
- #endif /* NDIR */
- #endif /* not (DIRENT or _POSIX_VERSION) */
-
-
- #if STDC_HEADERS || HAVE_STRING_H
- #include <string.h>
- /* An ANSI string.h and pre-ANSI memory.h might conflict. */
- #if !STDC_HEADERS && HAVE_MEMORY_H
- #include <memory.h>
- #endif /* not STDC_HEADERS and HAVE_MEMORY_H */
- #ifdef index
- #undef index
- #endif
- #define index strchr
- #ifdef rindex
- #undef rindex
- #endif
- #define rindex strrchr
- /* #define bcopy(s, d, n) memcpy ((d), (s), (n)) */
- #define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
- #define bzero(s, n) memset ((s), 0, (n))
- #else /* not STDC_HEADERS and not HAVE_STRING_H */
- #include <strings.h>
- /* memory.h and strings.h conflict on some systems. */
- #endif /* not STDC_HEADERS and not HAVE_STRING_H */
-
- #include <ctype.h> /* local version redefines string functions */
-
- /*
- * How about the memory copy routines ?
- */
- #if HAVE_BCOPY && BCOPY_OVERLAP
- /* ok: have bcopy() and it does overlapping copies */
- #else /* HAVE_BCOPY && BCOPY_OVERLAP */
- #if HAVE_MEMCPY && MEMCOPY_OVERLAP
- /* ok: have memcpy() and it does overlapping copies */
- #define bcopy(s, d, n) memcpy ((d), (s), (n))
- #else /* HAVE_MEMCPY && MEMCPY_OVERLAP */
-
- /* Neither bcopy() nor memcopy() do overlapping copies */
- #define bcopy(d, s, n) mybcopy ((d), (s), (n))
- #define NEED_MYBCOPY
- #endif /* HAVE_MEMCPY && MEMCPY_OVERLAP */
- #endif /* HAVEHAVE_BCOPY && BCOPY_OVERLAP */
-
- #ifdef undef
- extern double atof(/* const char *nptr */);
- extern int atoi(/* const char *nptr */);
- extern long int atol(/* const char *nptr */);
- #endif
- #ifdef AC_STDC_HEADERS
- #define ANSI_LIKE
- #else
- #define K_AND_R
- #endif
-
- /* set up the function prototyping convention */
-
- #ifdef ANSI_LIKE
- #define _AP(args) args
- #elif defined (PROTO_ANSI)
- #define _AP(args) args
- #elif defined(K_AND_R)
- #define _AP(args) ()
- #endif /* def ANSI_LIKE */
-
- /* if you are not k_and_r, then load in ustubs always */
- #ifdef K_AND_R
- #include "ustubs.h"
- #endif /* def K_AND_R */
-
- /* Comment this back in to figure out what the compiler thinks we are */
- /*
- #ifdef ANSI_LIKE
- WeareAnsiLike
- #endif
- #ifdef PROTO_ANSI
- WeareProtoAnsi
- #endif
- #ifdef K_AND_R
- WeareKandR
- #endif
- Crash-and-Burn
- */
- /* End of chunk to comment back in */
-
- #endif /* ndef C_DIALECT */
-
- /*----------------------------------------------------------------------*/
-
-
-